fix erroneous Qt translation caught by PVS studio.
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 23 Mar 2021 18:58:39 +0000 (12:58 -0600)
committertsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 23 Mar 2021 18:58:39 +0000 (12:58 -0600)
V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing.

This makes me wonder if this code is ever used.  If args == "OutputFromUnit"
it would throw a fatal error since b9cdbe4e8dc02cff07af9e0fa28adb2372337963 Oct 22, 2013

garmin_device_xml.cc

index 593670f3c0ed80e39164dc522e3e47c36a4ef91b..4591495258797401eb60fbafe934091c2bd693f7 100644 (file)
@@ -79,7 +79,7 @@ void dir_s(xg_string args, const QXmlStreamAttributes*)
   if (type) {
     return;
   }
-  if ((args == "OutputFromUnit")) {
+  if (args == "OutputFromUnit") {
     xasprintf(&my_gdx_info->from_device.path,  "%s%c%s",
               mountpoint, GB_PATHSEP, path);
     my_gdx_info->from_device.basename = xstrdup(base);
@@ -88,7 +88,7 @@ void dir_s(xg_string args, const QXmlStreamAttributes*)
               my_gdx_info->from_device.path,
               my_gdx_info->from_device.basename,
               my_gdx_info->from_device.extension);
-  } if ((args == "InputToUnit")) {
+  } else if (args == "InputToUnit") {
     xasprintf(&my_gdx_info->to_device.path,  "%s%c%s",
               mountpoint, GB_PATHSEP, path);
     my_gdx_info->to_device.basename = xstrdup(base);